//统一管理用户请求相关api
//引入自己封装的axios对象
import request from "@/utils/request";
import type { addRoleResponseData, getRoleListResponseData, roleInfoData } from "./type";

//定义用户相关的请求地址
//@ts-ignore
enum API{
    GET_LIST_URL="/manage/role/list",
    ADD_ROLE_URL="/manage/role/add",
    UPDATE_ROLE_URL="/manage/role/update",
}
//获取角色列表请求接口
export const getRoleList = ()=>request.get<any,getRoleListResponseData>(API.GET_LIST_URL);
//添加角色请求接口
export const insertRole = (data:roleInfoData)=>request.post<any,addRoleResponseData>(API.ADD_ROLE_URL,data);
//更新角色请求接口
export const updateRole = (data:roleInfoData)=>request.post<any,addRoleResponseData>(API.UPDATE_ROLE_URL,data);
